<html>
<head><meta charset="utf-8"><title>Define a default target · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Define.20a.20default.20target.html">Define a default target</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="195287600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Define%20a%20default%20target/near/195287600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> FuriouZz <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Define.20a.20default.20target.html#195287600">(Apr 25 2020 at 14:41)</a>:</h4>
<p>Hello everyone! QUESTION. Is there a way to tell rust-analyzer the default target I want to use ? By default, it use <code>x86_64-apple-darwin</code> but I want to target <code>wasm32-unknown-unknown</code>.</p>



<a name="195288213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Define%20a%20default%20target/near/195288213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Define.20a.20default.20target.html#195288213">(Apr 25 2020 at 14:57)</a>:</h4>
<p>cc <span class="user-mention" data-user-id="133169">@matklad</span></p>



<a name="195290371"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Define%20a%20default%20target/near/195290371" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Define.20a.20default.20target.html#195290371">(Apr 25 2020 at 15:50)</a>:</h4>
<p>Not at the moment, the relevant commands are hard-coded:</p>
<ul>
<li><a href="https://github.com/rust-analyzer/rust-analyzer/blob/fc57358efda7c028cbe8a438446cce5f540f48ca/crates/ra_project_model/src/lib.rs#L561-L564" title="https://github.com/rust-analyzer/rust-analyzer/blob/fc57358efda7c028cbe8a438446cce5f540f48ca/crates/ra_project_model/src/lib.rs#L561-L564">https://github.com/rust-analyzer/rust-analyzer/blob/fc57358efda7c028cbe8a438446cce5f540f48ca/crates/ra_project_model/src/lib.rs#L561-L564</a></li>
<li><a href="https://github.com/rust-analyzer/rust-analyzer/blob/fc57358efda7c028cbe8a438446cce5f540f48ca/crates/ra_project_model/src/cargo_workspace.rs#L149" title="https://github.com/rust-analyzer/rust-analyzer/blob/fc57358efda7c028cbe8a438446cce5f540f48ca/crates/ra_project_model/src/cargo_workspace.rs#L149">https://github.com/rust-analyzer/rust-analyzer/blob/fc57358efda7c028cbe8a438446cce5f540f48ca/crates/ra_project_model/src/cargo_workspace.rs#L149</a></li>
</ul>



<a name="195293795"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Define%20a%20default%20target/near/195293795" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> FuriouZz <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Define.20a.20default.20target.html#195293795">(Apr 25 2020 at 17:11)</a>:</h4>
<p>Well. Why not, I can see that.</p>



<a name="195307535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Define%20a%20default%20target/near/195307535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> FuriouZz <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Define.20a.20default.20target.html#195307535">(Apr 25 2020 at 23:27)</a>:</h4>
<p>Well...very complicated to setup a testing environment =/. Breakpoint does not work...</p>



<a name="195309140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Define%20a%20default%20target/near/195309140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> FuriouZz <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Define.20a.20default.20target.html#195309140">(Apr 26 2020 at 00:15)</a>:</h4>
<p>Is there some change expected for the get_rustc_cfg_options ? <br>
<a href="https://github.com/rust-analyzer/rust-analyzer/blob/fc57358efda7c028cbe8a438446cce5f540f48ca/crates/rust-analyzer/src/world.rs#L132" title="https://github.com/rust-analyzer/rust-analyzer/blob/fc57358efda7c028cbe8a438446cce5f540f48ca/crates/rust-analyzer/src/world.rs#L132">https://github.com/rust-analyzer/rust-analyzer/blob/fc57358efda7c028cbe8a438446cce5f540f48ca/crates/rust-analyzer/src/world.rs#L132</a><br>
<a href="https://github.com/rust-analyzer/rust-analyzer/blob/0ad6b6d40763f67cc727d000f616f88a47f43d41/crates/rust-analyzer/src/cli/load_cargo.rs#L150" title="https://github.com/rust-analyzer/rust-analyzer/blob/0ad6b6d40763f67cc727d000f616f88a47f43d41/crates/rust-analyzer/src/cli/load_cargo.rs#L150">https://github.com/rust-analyzer/rust-analyzer/blob/0ad6b6d40763f67cc727d000f616f88a47f43d41/crates/rust-analyzer/src/cli/load_cargo.rs#L150</a></p>



<a name="195354201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Define%20a%20default%20target/near/195354201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simlay <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Define.20a.20default.20target.html#195354201">(Apr 26 2020 at 21:51)</a>:</h4>
<p>I submitted <a href="https://github.com/rust-analyzer/rust-analyzer/issues/4163" title="https://github.com/rust-analyzer/rust-analyzer/issues/4163">https://github.com/rust-analyzer/rust-analyzer/issues/4163</a> with relevant words and links</p>



<a name="195354825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Define%20a%20default%20target/near/195354825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> FuriouZz <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Define.20a.20default.20target.html#195354825">(Apr 26 2020 at 22:08)</a>:</h4>
<p>Thanks <span class="user-mention" data-user-id="284190">@simlay</span> I was not really sure to create an issue for that haha. I started a PR (not sent yet), but still locked by the purpore of the <code>get_rustc_cfg_options()</code> call. I can make a draft PR.</p>



<a name="195355233"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Define%20a%20default%20target/near/195355233" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> FuriouZz <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Define.20a.20default.20target.html#195355233">(Apr 26 2020 at 22:16)</a>:</h4>
<p>My draft PR <a href="https://github.com/rust-analyzer/rust-analyzer/pull/4166" title="https://github.com/rust-analyzer/rust-analyzer/pull/4166">https://github.com/rust-analyzer/rust-analyzer/pull/4166</a></p>



<a name="195767832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Define%20a%20default%20target/near/195767832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> FuriouZz <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Define.20a.20default.20target.html#195767832">(Apr 29 2020 at 20:48)</a>:</h4>
<p>Any help?</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>